const app = getApp();
Component({
  mixins: [],
  data: {
    tags: []
  },
  props: {
    imgUrl: '',
    name: '',
    label: '',
    price: '',
    imgClass: '',
    nameClass: '',
    isHuabei: 2,
    minTerm: '',
    goodsId: ''
  },
  didMount() {
    const arr = this.props.label.replace(/,/g, '，').split('，').filter((p, idx) => p != '' && idx < 2);
    this.setData({
      tags: arr
    })
  },
  didUpdate() { },
  didUnmount() { },
  methods: {
    goToDetail() {
      if (this.props.goodsId) {
        my.navigateTo({
          url: '/pagesA/pages/productDetails/productDetails?goodsId=' + this.props.goodsId+'&sale_user_id='+app.globalData.sale_user_id
        });
      }
    }
  },
});
